package day8;

import java.util.Scanner;

public class Main2 {
    public static void main1(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextInt()) { // 注意 while 处理多个 case
            int a = in.nextInt();
            int b = in.nextInt();
            int max = (a > b ? a : b);
            int num = a*b;
            for(;max < num; max++) {
                if(max % a == 0 && max % b == 0) {
                    break;
                }
            }
            System.out.println(max);
        }
    }
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextInt()) { // 注意 while 处理多个 case
            int m = in.nextInt();
            int n = in.nextInt();
            int mn = gdc(m ,n);
            //最小公倍数=两个数乘积除以两个数的最小公约数
            System.out.println(m * n / mn);
        }
    }
    //辗转相除发找到最小公约数公约数
    public static int gdc(int m, int n) {
        if(m == n) {
            return m;
        }
        if(m < n) {
            int tmp = n;
            n = m;
            m = tmp;
        }
        int r = 0;
        while((r = m % n) > 0) {
            m = n;
            n = r;
        }
        return n;
    }
}
